﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DotNet.Common
{
    public partial class DynamicUserControl : UserControl
    {
        public DynamicUserControl()
        {
            InitializeComponent();
        }

        public event AddControlhandler OnAdd;
        public event ControlHandler OnDelete;

        private void linkLabelAdd_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (OnAdd != null)
                OnAdd();
        }

        private void linkLabelDelete_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (OnDelete != null)
                OnDelete(this);
        }
    }

    public interface IDynamicOperation
    {
        void Empty();
        int Num { set; }
    }

    public delegate UserControl AddControlhandler();
    public delegate void ControlHandler(UserControl control);
    public delegate void IndexControlHandler(UserControl control, int index);
}
